{% load static %}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Stark</title>
    <link rel="shortcut icon" href="{% static 'stark/favicon.png' %}">
    <link rel="stylesheet" href="{% static 'stark/layui/css/layui.css' %}">
    {% block header %}

    {% endblock %}
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">Stark</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="#">站点</a></li>
            <li class="layui-nav-item"><a href="#">控制台</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;">其它</a>
                <dl class="layui-nav-child">
                    <dd><a href="#">邮件管理</a></dd>
                    <dd><a href="#">消息管理</a></dd>
                    <dd><a href="#">授权管理</a></dd>
                </dl>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">{{ request.user }}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="#">基本资料</a></dd>
                    <dd><a href="#">安全设置</a></dd>
                    <dd><a href="#">退了</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll" id="side-menu">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                {% for key, url_li in all_menu.items %}
                    <li class="layui-nav-item">
                        <a class="" href="javascript:;">{{key}}</a>
                        <dl class="layui-nav-child">
                            {% for render_url in url_li %}
                                {% for name, render_url in  render_url.items %}
                                    <dd><a href="{% url render_url %}">{{name}}</a></dd>
                                {% endfor %}
                            {% endfor %}
                        </dl>
                    </li>
                {% endfor %}

            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">
            {% block main %}

            {% endblock %}
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © layui.com - 底部固定区域
    </div>
</div>
<script src="{% static 'stark/layui/layui.all.js' %}"></script>
<script>
    layui.use(['form', 'jquery'], function () {
        var form = layui.form;
        var $ = layui.jquery;

        let curr_link = $('#side-menu a[href="'+ location.pathname +'"]')
        curr_link.parent().addClass('layui-this')
        curr_link.parents('.layui-nav-item').addClass('layui-nav-itemed')
    })
</script>
{% block footer %}

{% endblock %}
</body>
</html>